<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex align-stretch benben-position-layout flex paySetPassword_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex align-center justify-between flex-sub paySetPassword_fd0_0'>
					<view class='flex align-center paySetPassword_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">
						<text class='fu-iconfont2  paySetPassword_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex align-center'>
						<text class='paySetPassword_fd0_0_c1_c0'>支付密码</text>
					</view>
					<view class='flex align-center paySetPassword_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-center benben-flex-layout">
				<text class='paySetPassword_fd1_0'>新密码</text>
				<text class='paySetPassword_fd1_1'>新支付密码，用于支付验证</text>
				<benben-digital-password :box-num='6' mode='password'
					class-name='flex flex align-center justify-center paySetPassword_fd1_2' @confirm="checkCodeFunc()"
					v-model="password" :init-open.sync="xianshi">
					<template #default="{ content, active, index }">
						<view :key="index" v-if="active"
							class="flex align-center justify-center active-digital-password paySetPassword_flex_password_active_fd1_2">
							{{ content }}
						</view>
						<view :key="index" v-else
							class="flex align-center justify-center paySetPassword_flex_password_active_fd1_2">
							{{ content }}
						</view>
					</template>
				</benben-digital-password>
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"password": "",
				"xianshi": false
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {

		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//校验验证码
			checkCodeFunc() {
				if (!validate(this.password, 'require')) {
					this.$message.info('请输入支付密码');
					return false;
				}
				if (!validate(this.password, 'length', '6')) {
					this.$message.info('请输入6位数字支付密码');
					return false;
				}
				this.$urouter.navigateTo(`/pages/set/confirmNewPassword/confirmNewPassword?password=${this.password}`);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.paySetPassword_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.paySetPassword_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.paySetPassword_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.paySetPassword_fd0_0_c0 {
		width: 180rpx;
	}

	.paySetPassword_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.paySetPassword_flex_password_active_fd1_2 {
		border: 1px solid rgba(171, 171, 171, 1);
		width: 100rpx;
		height: 100rpx;
	}

	::v-deep .paySetPassword_fd1_2 {
		margin: 64rpx 0rpx 0rpx 0rpx;
	}

	.paySetPassword_fd1_1 {
		color: #999999;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.paySetPassword_fd1_0 {
		font-size: 40rpx;
		font-weight: 700;
		color: #333333;
		margin: 175rpx 0rpx 20rpx 0rpx;
		line-height: 56rpx;
	}
</style>